function invertTree(root){
    if(root ===null) return null;
    
    const temp = root.left;
    root.left = root.right;
    root.right = temp;
    return root;
}